DEFtype Statements ---------------------------------------------------------------------------- Action Set the default data type for variables, DEF FN functions, and FUNCTION procedures. Syntax DEFINT letterrange -, letterrange-... DEFLNG letterrange-, letterrange-... DEFSNG letterrange-, letterrange-... DEFDBL letterrange-, letterrange-... DEFCUR letterrange-, letterrange-... DEFSTR letterrange -, letterrange-... Remarks The letterrange argument has the form. letter1 -- letter2- The arguments letter1 and letter2 are any of the uppercase or lowercase letters of the alphabet. Names beginning with the letters in letterrange have the type specified by the last three letters of the statement. integer ( INT), long integer ( LNG), single precision ( SNG), double precision ( DBL), currency ( CUR), or string ( STR). For example, in the following program fragment, Message is a string variable. DEFSTR A-Q . . . Message="Out of stack space." The case of the letters in letterrange is not significant. These three statements are equivalent. DEFINT I-N DEFINT i-n DEFINT i-N A type-declaration character ( %, &, !, #, @, or $) always takes precedence over a DEF type statement. DEF type statements do not affect record elements. Note I%, I&, I!, I#, I@, and I$ all are distinct variables, and each may hold a different value. BASICA BASICA handles default data types differently. BASICA scans each statement before executing it. If the statement contains a variable without an explicit type (indicated by %, &, !, #, @, or $), the interpreter uses the current default type. In contrast, BASIC scans the text once only and after a variable appears in a program line, its type cannot be changed. Example See the ABS function programming example, which uses the DEFDBL statement.